// get_arg.h
//

#if !defined(GETARG_H)
#define GETARG_H

#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <bcpp_seq_formats.h>


class t_program_args
{
public:
	t_program_args():
		log_to_file(false){}
	// for initializing this struct
	friend
	bool process_command_line_options(int argc, char* argv[], t_program_args& args);
	std::ostream&	VERBOSE() {return verbose ? std::cerr : strm_ignore;}
	std::ostream&	CERR(){if (log_to_file) return f_err_log; return std::cerr;}


	bool IsVerbose() const	{return verbose;}
	BioCPP::eSEQ_FORMAT	input_format;
	BioCPP::eSEQ_FORMAT	output_format;
	bool				header;
	std::string			regex;
	std::string			sequences_file;
	std::vector<unsigned> pos_indices;
	unsigned			line_wrap;
	bool				alpha;
	bool				names;

	void open_log_files();
private:
	bool				log_to_file;
	std::string			err_log_name;
	std::ofstream		f_err_log;

	bool				verbose;
	std::ostringstream 	strm_ignore;
};

bool process_command_line_options(int argc, char* argv[], t_program_args& args);
#endif //GETARG_H

